package BlogMybatis.blog.pojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author Brandt
 * @since 2020-06-17
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
public class Message implements Serializable {

    private static final long serialVersionUID=1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    private String nickname;

    private String email;

    private String openid; //评论者的openid,默认为空。判断是否博主评论的凭证

    private String content;

    private String avatar;

    private Date createTime;

    private Long parentMessageId;

    private Integer adminMessage; //评论类型：0游客评论，1 访客评论，2 博主评论，3 GitHub用户评论

    /**
     * 是否开启回复通知
     */
    private Boolean replyInform;

    @TableField(exist = false)
    private List<Message> replyMessages = new ArrayList<>(); //一个评论下面有多个子回复
    @TableField(exist = false)
    private Message parentMessage; //父级评论
    @TableField(exist = false)
    private String parentNickname; //父级评论的名称


}
